<template>
  <van-nav-bar
        class="tab"
            :title="title"
            left-text="返回"
            left-arrow
            @click-left="onClickLeft"
        />
</template>

<script setup>
import {useRouter} from "vue-router"

defineProps({
    title:{
        type:String,
        default:"标题"
    }
})

const router = useRouter()
function onClickLeft(){
    router.back()
}

</script>

<style lang="less" scoped>
.tab {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    background-color: #fff;
    height: 30px;
    width: 100%;
    ::v-deep(.van-nav-bar__content){
        height: 30px;
    }
}
</style>